package com.yc.auction.actions;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.yc.auction.dao.IProductInfoDao;
import com.yc.auction.dao.impl.ProductInfoDaoImpl;
import com.yc.auction.entity.JsonObject;

@SuppressWarnings("serial")
public class ProductAction extends ActionSupport{
	private HttpSession session;
	private IProductInfoDao productInfoDao=new ProductInfoDaoImpl();
	private JsonObject jsonObject;
	
	public JsonObject getJsonObject() {
		return jsonObject;
	}

	public void setJsonObject(JsonObject jsonObject) {
		this.jsonObject = jsonObject;
	}

	{
		session=ServletActionContext.getRequest().getSession();
	}
	
	public String findProductInfo(){
		jsonObject=new JsonObject();
		jsonObject.setRows(productInfoDao.findByOnline());
		//获取当前登录用户信息
		jsonObject.setObj(  session.getAttribute("currentUser") );
		return "success";
	}
}
